home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindspring.com!usenet
- From: vtipres@atl.mindspring.com (Shon Frazier)
- Newsgroups: comp.lang.c
- Subject: String Problem
- Date: Mon, 25 Mar 1996 17:33:02 GMT
- Organization: MindSpring Enterprises, Inc.
- Message-ID: <4j6l61$4no@B1FF.mindspring.com>
- Reply-To: vtipres@atl.mindspring.com
- NNTP-Posting-Host: user-168-121-120-68.dialup.mindspring.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- This is supposed to be a variation on sample code from a textbook.
- Can anyone tell me why NameCheck = 0 when I run the program?
-
- /*
- Testing character transactions.
- */
-
- #include <stdio.h>
- #include <ctype.h>
-
- int main()
- {
- char Name[11] = "John";
- char *WhereName;
- int NameCheck = 0;
-
- WhereName = Name;
-
- if ( WhereName == "John" )
- {
- NameCheck = 1;
- }
-
- printf( "Name: %s\n", Name );
- printf( "NameCheck = %i\n", NameCheck );
- printf( "WhereName = %i\n", WhereName );
- }
-
-
-